package com.pty.mercuryservice.repository;

import com.pty.mercuryservice.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by Empty on 2017/7/4.
 */
public interface UserRepository extends JpaRepository<User, Long> {

    User findByUsername(String username);

    @Query("select u from User u where u.username=:username")
    User findUser(@Param("username") String username);

}
